
const _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault');

exports.__esModule = true;
exports.SlotsMixin = void 0;

const _vue = _interopRequireDefault(require('vue'));

/**
 * Use scopedSlots in Vue 2.6+
 * downgrade to slots in lower version
 */
const SlotsMixin = _vue.default.extend({
  methods: {
    slots: function slots(name, props) {
      if (name === void 0) {
        name = 'default';
      }

      const { $slots } = this;
      const { $scopedSlots } = this;
      const scopedSlot = $scopedSlots[name];

      if (scopedSlot) {
        return scopedSlot(props);
      }

      return $slots[name];
    },
  },
});

exports.SlotsMixin = SlotsMixin;
